<!DOCTYPE html>
<html class="no-js">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>EasyQueue</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="shortcut icon" href="/img/1367329744_17256.ico">
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<style type="text/css">
body {
  padding-top: 20px;
  padding-bottom: 40px;
}
</style>

</head>

<body>

  <!-------------- DESKTOP SITE -------------->
  <div class="container-narrow visible-desktop"></div>
  <!-- End Desktop

  <!-------------- MOBILE SITE -------------->
  <div class="container-fluid hidden-desktop" align="center"></div>
  <!-- End Mobile -->

  <!--MODULS-->



  <div id="add_user" style="background-color: #E6E6FA;" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <form id="user_data" action="/auto_join" onsubmit="return validate();">
      <div class="modal-header">
        <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3 id="myModalLabel" style="text-align: right; direction: rtl;">הצטרפות לתור "{{queue_name}}"</h3>
      </div>
      <div class="modal-body">
        <div style="float: right">
          <dt id=add_user_user_type style="text-align: right;">הכנס את שמך</dt>
          <input type="text" style="display: none;" name=queue_id /> 
          <input id=add_user_user_type_input type="text" style="float: right; text-align: right;" value="{{user_name}}" name="user_name" placeholder="שם פרטי ומשפחה" /><br>
          <dt style="text-align: right;">הכנס טלפון</dt>
          <input id="user_phone" type="text" style="float: right; text-align: right;" value="{{user_phone}}" name="user_phone" placeholder="מספר טלפון" />
          <h6 style="text-align: right; direction:rtl;">*התראת SMS תשלח למספר זה כשתורך יגיע</h6>
		</div>
      </div>
      <div class="modal-footer" style="background-color: #E6E6FA;">
        <button type="button" class="btn pull-left" data-dismiss="modal" aria-hidden="true">ביטול</button>
        <button type="submit" class="btn btn-primary pull-left">אישור</button>
      </div>
    </form>
  </div>


  <!-------------- JavaScripts -------------->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
  <script src="js/vendor/bootstrap.min.js"></script>
  <script src="js/main.js"></script>
  <script>
	        var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
	        (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
	        g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
	        s.parentNode.insertBefore(g,s)}(document,'script'));
	    </script>
  <script>$(".alert").alert()</script>

  <script> 
		$('input[name=queue_id]').val('{{queue_id}}');
  </script>
  
  <script>
	var q_type="0";
	function validate(){
        var name = (document.forms["user_data"]["user_name"].value).toString();
        var phone = (document.forms["user_data"]["user_phone"].value).toString();
        if ((name == "")&&(q_type!="2")){
            window.alert("אין להשאיר את השדה הראשון ריק. הפעולה נכשלה");
			return false;
		}
        else{
            window.location('auto_join?queue_id=' + queue_id + '&user_name=' + name + '&user_phone=' + phone);
        }
    }
  </script>

  <script>
function update_add_user_modal(queue_type){
	q_type=queue_type;
	if (queue_type=="0"){
		$('#add_user_user_type').text("הכנס את שמך");
		$('#add_user_user_type_input').attr("placeholder","שם פרטי ומשפחה");
		$('#add_user_user_type').show();
		$('#add_user_user_type_input').show();
	}
	if (queue_type=="1"){
		$('#add_user_user_type').text("הכנס מספר ת.ז");
		$('#add_user_user_type_input').attr("placeholder","מספר ת.ז");
		$('#add_user_user_type').show();
		$('#add_user_user_type_input').show();
	}
	if (queue_type=="2"){
		$('#add_user_user_type').hide();
		$('#add_user_user_type_input').hide();
	}


}

</script>



<script>
    
    update_add_user_modal("{{queue_type}}");
    $("#add_user").modal("show");
</script>

</body>
</html>

